Skip to content

fix flaky search index application#26795

Merged
shrabantipaul-collate merged 8 commits intomainfrom
fix-searchIndexApplication-specs
Mar 30, 2026
Merged

fix flaky search index application#26795
shrabantipaul-collate merged 8 commits intomainfrom
fix-searchIndexApplication-specs

Conversation

@shrabantipaul-collate
Copy link
Copy Markdown
Contributor

@shrabantipaul-collate shrabantipaul-collate commented Mar 26, 2026

Describe your changes:

Fixes

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Summary by Gitar

  • Test refactoring:
    • Extracted installSearchIndexApplication function to reduce duplication and enable recovery from failed retries
    • Added self-healing guard that reinstalls app via API if previous retry left it uninstalled
  • Test robustness:
    • Added API-based app check and reinstallation to prevent flaky test failures from retry state

This will update automatically on new commits.

@shrabantipaul-collate shrabantipaul-collate requested a review from a team as a code owner March 26, 2026 10:33
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
65% (58732/90354) 44.75% (30898/69045) 47.89% (9318/19455)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

🟡 Playwright Results — all passed (20 flaky)

✅ 3419 passed · ❌ 0 failed · 🟡 20 flaky · ⏭️ 216 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 453 0 2 2
🟡 Shard 2 606 0 2 32
🟡 Shard 3 610 0 4 27
🟡 Shard 4 611 0 6 47
🟡 Shard 5 585 0 2 67
🟡 Shard 6 554 0 4 41
🟡 20 flaky test(s) (passed on retry)
  • Features/CustomizeDetailPage.spec.ts › Glossary Term - customization should work (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/Glossary/GlossaryStatusFilterNestedTerms.spec.ts › all children have same status different from parent (shard 2, 1 retry)
  • Features/Permissions/GlossaryPermissions.spec.ts › Team-based permissions work correctly (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show "Active recently" for users active within last hour (shard 3, 1 retry)
  • Flow/ExploreDiscovery.spec.ts › Should display deleted assets when showDeleted is checked and deleted is not present in queryFilter (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DomainDataProductsRightPanel.spec.ts › Should display overview tab for data product (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Data Product announcement create, edit & delete (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Rename domain with data products attached at domain and subdomain levels (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Domain Rbac (shard 4, 1 retry)
  • Pages/Entity.spec.ts › User as Owner with unsorted list (shard 4, 1 retry)
  • Pages/EntityDataSteward.spec.ts › Follow & Un-follow entity (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should verify deleted user not visible in owner selection for table (shard 5, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Comment on lines +171 to +178
await apiContext.post('/api/v1/apps', {
data: {
name: 'SearchIndexingApplication',
displayName: 'Search Indexing',
appConfiguration,
appSchedule: { scheduleTimeline: 'None' },
},
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: Self-healing API POST lacks response-status check

The self-healing guard (lines 171-178) creates the app via apiContext.post('/api/v1/apps', …) but never inspects the response. If the POST fails (e.g., 400 due to a schema change or 500), the test will proceed as if the app is installed, leading to a confusing downstream failure that obscures the real cause.

Adding a status assertion gives a clear, early failure message.

Suggested fix:

const installRes = await apiContext.post('/api/v1/apps', {
  data: {
    name: 'SearchIndexingApplication',
    displayName: 'Search Indexing',
    appConfiguration,
    appSchedule: { scheduleTimeline: 'None' },
  },
});
expect(installRes.ok()).toBeTruthy();

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Mar 30, 2026

Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Stabilizes flaky search index application tests with targeted fixes. Consider adding response-status validation to the self-healing API POST to ensure proper error handling.

💡 Edge Case: Self-healing API POST lacks response-status check

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchIndexApplication.spec.ts:171-178

The self-healing guard (lines 171-178) creates the app via apiContext.post('/api/v1/apps', …) but never inspects the response. If the POST fails (e.g., 400 due to a schema change or 500), the test will proceed as if the app is installed, leading to a confusing downstream failure that obscures the real cause.

Adding a status assertion gives a clear, early failure message.

Suggested fix
const installRes = await apiContext.post('/api/v1/apps', {
  data: {
    name: 'SearchIndexingApplication',
    displayName: 'Search Indexing',
    appConfiguration,
    appSchedule: { scheduleTimeline: 'None' },
  },
});
expect(installRes.ok()).toBeTruthy();
🤖 Prompt for agents
Code Review: Stabilizes flaky search index application tests with targeted fixes. Consider adding response-status validation to the self-healing API POST to ensure proper error handling.

1. 💡 Edge Case: Self-healing API POST lacks response-status check
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchIndexApplication.spec.ts:171-178

   The self-healing guard (lines 171-178) creates the app via `apiContext.post('/api/v1/apps', …)` but never inspects the response. If the POST fails (e.g., 400 due to a schema change or 500), the test will proceed as if the app is installed, leading to a confusing downstream failure that obscures the real cause.
   
   Adding a status assertion gives a clear, early failure message.

   Suggested fix:
   const installRes = await apiContext.post('/api/v1/apps', {
     data: {
       name: 'SearchIndexingApplication',
       displayName: 'Search Indexing',
       appConfiguration,
       appSchedule: { scheduleTimeline: 'None' },
     },
   });
   expect(installRes.ok()).toBeTruthy();

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@shrabantipaul-collate shrabantipaul-collate merged commit 3f86d4a into main Mar 30, 2026
44 checks passed
@shrabantipaul-collate shrabantipaul-collate deleted the fix-searchIndexApplication-specs branch March 30, 2026 10:03
@github-actions
Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.12.4 branch.
Please cherry-pick the changes manually.
You can find more details here.

ulixius9 pushed a commit that referenced this pull request Mar 30, 2026
* fix flaky search index application

* fix lint issues

* address review comments

---------

Co-authored-by: Shrabanti Paul <shrabantipaul@Shrabantis-MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants